Accurate Line Measurement
TextEdit measures a line accurately by removing any trailing white space from the end of the line and taking the line direction into ac count. It uses the
that occurs on the right side of the display line for a script system with a
left-to-right line direction (TESysJust = 0) and with flush-right alignment
(teJust = teJustRight or teFlushRight). It also uses VisibleLength if the text
alignment is flush left (teJust = teForceLeft or teFlushLeft ) regardless of the
line direction.
Note: An anomaly exists in the way TextEdit draws at line ends. When the primary line direction of a script system is right to left (for instance, on an
Arabic system), when the alignment is teFlushLeft or teCenter, and when
spaces are being entered in a right-to-left font, TextEdit measures spaces at the end of the line and thus may draw the text beyond the right edge of the view
rectangle. The caret, however, remains in view and is pinned to the left edge of
the view rectangle.
This anomaly also exists when the primary line direction of a script system
is left to right and the alignment is teCenter. In this instance,TextEdit measures spaces at the end of the line. As more spaces are added (and, thus
measured), the visible text in the line is drawn out of view beyond the left edge
of the view rectangle. The caret, however, remains in view and is pinned to the
right edge of the view rectangle.